﻿using System;
using System.Collections.Generic;

namespace Fuse8.ContentManagementFramework.Domain
{
    public partial class CmsUserGroup : IEqualityComparer<CmsUserGroup>
    {
        public const string UserGroupColorMetaFieldName = "UserGroupColor";

        public const string DefaultUserGroupColor = "#c0d53a";

        public string GroupNameWithSiteName
        {
            get
            {
                return GroupName + (Site != null && !string.IsNullOrEmpty(Site.SiteName) ? " (" + Site.SiteName + ")" : string.Empty);
            }
        }

        #region IEqualityComparer<CmsUserGroup> Members

        public bool Equals(CmsUserGroup x, CmsUserGroup y)
        {
            return x.Id.Equals(y.Id);
        }

        public int GetHashCode(CmsUserGroup obj)
        {
            return obj.Id.GetHashCode();
        }

        #endregion IEqualityComparer<CmsUserGroup> Members
    }
}